package com.attilax.ui;

import java.awt.Toolkit;

import javax.swing.JOptionPane;

public class MsgBox {
	public static int ok=0;
	public static int cancel=2;
	public static void main(String[] args) {
		confirm("aa");
	}

	public static void setTxt(String string) {
		//不带图标 alert
		Toolkit.getDefaultToolkit().beep();
		JOptionPane.showMessageDialog(null, string, "标题", JOptionPane.PLAIN_MESSAGE);
		
	}

		/**
		@author attilax 老哇的爪子
		@since   obn d_8_5
		 
		 */
	public static void show(String string) {
		setTxt(string);
		
	}
	
	public static boolean confirm(String string) {
		// JOptionPane.
		// 不带图标 alert
		Toolkit.getDefaultToolkit().beep();
		int n = JOptionPane.showConfirmDialog(null, string, "标题",
				JOptionPane.OK_CANCEL_OPTION);
		System.out.println(n);
		if (n == 0)
			return true;
		return false;

	}

}
